texture: Add gdk_texture_download_texture()
authorBenjamin Otte <otte@redhat.com>
Sun, 12 Sep 2021 02:42:24 +0000 (04:42 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 12 Sep 2021 03:22:21 +0000 (05:22 +0200)
commit4f17f3ac240117ae38cd83e3c8140a4b2a8dccff
tree669601e7ecdcd02945ed7cd8ad0cafa39f59271b
parent9c8e464b04768c45f9043711a06a2d6eb9ab6076
texture: Add gdk_texture_download_texture()

A private vfunc that downloads a texture as a GdkMemoryTexture in
whatever format the texture deems best.

There are multiple reasons for this:

 * GLES cannot download the Cairo format. But it can download some
   format and then just delegate to the GdkMemoryTexture implementation.

 * All the other download vfuncs (including the ones still coming) can
   be implemented via download_texture() and delegation, making the
   interface easier.

 * We want to implement image loading and saving support. By using
   download_texture(), we can save in the actual format of the texture.

 * A potential GdkCompressedTexture could be implemented by just
   providing this one vfunc as a compress() step.
gdk/gdkgltexture.c
gdk/gdkmemorytexture.c
gdk/gdktexture.c
gdk/gdktextureprivate.h